package cate.common.table.pvp.guildwar.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.util.random.RWItem;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("宝库奖励")
public class GuildWarTreasureRow extends ERow implements RWItem {

    @NoteField("开服天数起始")
    public int startDay;

    @NoteField("开服天数结束")
    public int endDay;

    @NoteField("商品ID")
    public int itemId;

    @NoteField("数量")
    public int num;

    @NoteField("类型")
    public int type;

    @NoteField("权重")
    public double weight;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID", 0);
        this.startDay = xrw.getInteger("开服天数起始", 0);
        this.endDay = xrw.getInteger("开服天数结束", 0);
        this.itemId = xrw.getInteger("商品ID", 0);
        this.num = xrw.getInteger("数量", 0);
        this.type = xrw.getInteger("类型", 0);
        this.weight = xrw.getDouble("权重", 0d);

    }

    @Override
    public double getWeight() {
        return weight;
    }
}
